<template>
    <div>
        <p>
            姓名<input type="text" v-model="userData.name">
        </p>
        <p>
            年龄<input type="number" v-model="userData.age">
        </p>
        <p>
            <button @click="submit">提交</button>
        </p>
    </div>
</template>

<script lang='ts' setup>
const router = useRouter()
let user = userInfo()
let userData = reactive({
    name: '',
    age: 10,
})
const submit = () => {
    user.value = userData
    router.push({ path: '/article' })
}
</script>